/**
 * Description:
 * Class Name:Client
 * Date:2022/5/24 14:33
 *
 * @author LTisme
 * @version JAVA17
 */
package 疯狂Java讲义.第17章_网络编程._17_3_基于TCP协议的网络编程._17_3_6_半关闭的Socket;

import java.io.*;
import java.net.*;
import java.util.*;


public class Client {
    public static void main(String[] args)
            throws Exception {
        var s = new Socket("localhost", 30000);
        var scan = new Scanner(s.getInputStream());
        while (scan.hasNextLine()) {
            System.out.println(scan.nextLine());
        }
        var ps = new PrintStream(s.getOutputStream());
        ps.println("客户端的第一行数据");
        ps.println("客户端的第二行数据");
        ps.close();
        scan.close();
        s.close();
    }
}
